package ar.frba.utn.diseñosistemas.TP1;

import java.util.Date;
import java.text.*;

public class SimpleParser extends DateParser 
{
	private DateFormat formater;
	
	public SimpleParser(String datePattern)
	{
		this.formater = new SimpleDateFormat(datePattern);
		this.formater.setLenient(false);
	}
	
	@Override
	public UnifiedDate Parse(String stringToFormat) throws Exception 
	{
		Date parsedDate = this.formater.parse(stringToFormat);
		
		return new UnifiedDate(parsedDate);
	}

}
